Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feat: Setting as pages #3813

Merged
merged 41 commits into from
Jan 20, 2025
Merged

Feat: Setting as pages #3813

merged 41 commits into from
Jan 20, 2025

Conversation

Mikehrn
Copy link
Contributor

@Mikehrn Mikehrn commented Jan 14, 2025

This PR moves away from the settings modal in favor of having them as pages. Some clean-up and bugfixes have been done for the content overall no changes have been made. There is still some room for improvement there, but we can address these in follow-up PRs

@@ -123,3 +123,11 @@ export const workspaceWizardRegionQuery = graphql(`
}
}
`)

export const workspaceGetIdBySlugQuery = graphql(`
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some queries are not possible with workspaceBySlug, as nested properties in some cases need an ID and don't work with slug, so this call is done first to get the id

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There used to be that hack where we just take the workspace's id from the apollo cache, cause it should already be there from the access checks done in middlewares. Can we do that here too?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do you remember which hack this was, or maybe @andrewwallacespeckle knows? I vaguely remember it, but dont remember where we are doing this

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't know, I think Andrew will know more

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Worked around this by refactoring some of the child components to use workspaceBySlug

@Mikehrn Mikehrn marked this pull request as ready for review January 15, 2025 11:15
Copy link
Contributor

@fabis94 fabis94 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks very good for the most part, great to see a lot of this cleaned up

packages/frontend-2/lib/settings/composables/menu.ts Outdated Show resolved Hide resolved
packages/frontend-2/components/settings/Sidebar.vue Outdated Show resolved Hide resolved
packages/frontend-2/components/settings/Sidebar.vue Outdated Show resolved Hide resolved
packages/frontend-2/components/settings/Sidebar.vue Outdated Show resolved Hide resolved
packages/frontend-2/pages/settings/server/members.vue Outdated Show resolved Hide resolved
packages/frontend-2/pages/settings/user/profile.vue Outdated Show resolved Hide resolved
@Mikehrn Mikehrn requested a review from fabis94 January 20, 2025 11:35
fabis94
fabis94 previously approved these changes Jan 20, 2025
Copy link
Contributor

@fabis94 fabis94 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks good

appMiddleware: ['auth', 'settings', 'admin']
},
'/settings/workspaces/*': {
appMiddleware: ['auth', 'settings', 'admin', 'requires-workspaces-enabled']
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

shouldn't these also have the workspace access check middleware?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good point, I added it!

appMiddleware: ['auth', 'settings']
},
'/settings/server/*': {
appMiddleware: ['auth', 'settings', 'admin']
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

hoping these don't get added & invoked twice (cause of the /settings/** rule above)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It won't, I actually tried that first as I assumed it does, but it will only use one of the routeRules (thats the closest match)

@Mikehrn Mikehrn merged commit d77af22 into main Jan 20, 2025
26 of 28 checks passed
@Mikehrn Mikehrn deleted the mike/settings-as-pages branch January 20, 2025 12:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants